USE [master]
GO
/****** Object:  Database [EIP_Quartz]    Script Date: 2018/3/14 11:32:09 ******/
CREATE DATABASE [EIP_Quartz]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'EIP_Quartz', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\EIP_Quartz.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'EIP_Quartz_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\EIP_Quartz_log.ldf' , SIZE = 2048KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [EIP_Quartz] SET COMPATIBILITY_LEVEL = 120
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [EIP_Quartz].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [EIP_Quartz] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [EIP_Quartz] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [EIP_Quartz] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [EIP_Quartz] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [EIP_Quartz] SET ARITHABORT OFF 
GO
ALTER DATABASE [EIP_Quartz] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [EIP_Quartz] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [EIP_Quartz] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [EIP_Quartz] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [EIP_Quartz] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [EIP_Quartz] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [EIP_Quartz] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [EIP_Quartz] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [EIP_Quartz] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [EIP_Quartz] SET  DISABLE_BROKER 
GO
ALTER DATABASE [EIP_Quartz] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [EIP_Quartz] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [EIP_Quartz] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [EIP_Quartz] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [EIP_Quartz] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [EIP_Quartz] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [EIP_Quartz] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [EIP_Quartz] SET RECOVERY FULL 
GO
ALTER DATABASE [EIP_Quartz] SET  MULTI_USER 
GO
ALTER DATABASE [EIP_Quartz] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [EIP_Quartz] SET DB_CHAINING OFF 
GO
ALTER DATABASE [EIP_Quartz] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [EIP_Quartz] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
ALTER DATABASE [EIP_Quartz] SET DELAYED_DURABILITY = DISABLED 
GO
EXEC sys.sp_db_vardecimal_storage_format N'EIP_Quartz', N'ON'
GO
USE [EIP_Quartz]
-- ----------------------------
-- Table structure for QRTZ_BLOB_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [BLOB_DATA] varbinary(max)  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_BLOB_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_BLOB_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_CALENDARS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_CALENDARS]
GO

CREATE TABLE [dbo].[QRTZ_CALENDARS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CALENDAR_NAME] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CALENDAR] varbinary(max)  NOT NULL
)
GO

ALTER TABLE [dbo].[QRTZ_CALENDARS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_CALENDARS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_CRON_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CRON_EXPRESSION] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TIME_ZONE_ID] nvarchar(80) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_CRON_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_FIRED_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ENTRY_ID] nvarchar(140) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [INSTANCE_NAME] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [FIRED_TIME] bigint  NOT NULL,
  [SCHED_TIME] bigint  NOT NULL,
  [PRIORITY] int  NOT NULL,
  [STATE] nvarchar(16) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [JOB_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NULL,
  [JOB_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NULL,
  [IS_NONCONCURRENT] bit  NULL,
  [REQUESTS_RECOVERY] bit  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_FIRED_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_JOB_DETAILS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
GO

CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [JOB_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [JOB_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DESCRIPTION] nvarchar(250) COLLATE Chinese_PRC_CI_AS  NULL,
  [JOB_CLASS_NAME] nvarchar(250) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [IS_DURABLE] bit  NOT NULL,
  [IS_NONCONCURRENT] bit  NOT NULL,
  [IS_UPDATE_DATA] bit  NOT NULL,
  [REQUESTS_RECOVERY] bit  NOT NULL,
  [JOB_DATA] varbinary(max)  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_JOB_DETAILS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_LOCKS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_LOCKS]
GO

CREATE TABLE [dbo].[QRTZ_LOCKS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [LOCK_NAME] nvarchar(40) COLLATE Chinese_PRC_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[QRTZ_LOCKS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_LOCKS
-- ----------------------------
INSERT INTO [dbo].[QRTZ_LOCKS] ([SCHED_NAME], [LOCK_NAME]) VALUES (N'EIPScheduler', N'STATE_ACCESS')
GO

INSERT INTO [dbo].[QRTZ_LOCKS] ([SCHED_NAME], [LOCK_NAME]) VALUES (N'EIPScheduler', N'TRIGGER_ACCESS')
GO


-- ----------------------------
-- Table structure for QRTZ_PAUSED_TRIGGER_GRPS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
GO

CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_PAUSED_TRIGGER_GRPS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_SCHEDULER_STATE
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
GO

CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [INSTANCE_NAME] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [LAST_CHECKIN_TIME] bigint  NOT NULL,
  [CHECKIN_INTERVAL] bigint  NOT NULL
)
GO

ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_SCHEDULER_STATE
-- ----------------------------
INSERT INTO [dbo].[QRTZ_SCHEDULER_STATE] ([SCHED_NAME], [INSTANCE_NAME], [LAST_CHECKIN_TIME], [CHECKIN_INTERVAL]) VALUES (N'EIPScheduler', N'instance_one', N'638613540337862900', N'2000')
GO


-- ----------------------------
-- Table structure for QRTZ_SIMPLE_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [REPEAT_COUNT] int  NOT NULL,
  [REPEAT_INTERVAL] bigint  NOT NULL,
  [TIMES_TRIGGERED] int  NOT NULL
)
GO

ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_SIMPLE_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_SIMPROP_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [STR_PROP_1] nvarchar(512) COLLATE Chinese_PRC_CI_AS  NULL,
  [STR_PROP_2] nvarchar(512) COLLATE Chinese_PRC_CI_AS  NULL,
  [STR_PROP_3] nvarchar(512) COLLATE Chinese_PRC_CI_AS  NULL,
  [INT_PROP_1] int  NULL,
  [INT_PROP_2] int  NULL,
  [LONG_PROP_1] bigint  NULL,
  [LONG_PROP_2] bigint  NULL,
  [DEC_PROP_1] numeric(13,4)  NULL,
  [DEC_PROP_2] numeric(13,4)  NULL,
  [BOOL_PROP_1] bit  NULL,
  [BOOL_PROP_2] bit  NULL,
  [TIME_ZONE_ID] nvarchar(80) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_SIMPROP_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Table structure for QRTZ_TRIGGERS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND type IN ('U'))
	DROP TABLE [dbo].[QRTZ_TRIGGERS]
GO

CREATE TABLE [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] nvarchar(120) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [JOB_NAME] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [JOB_GROUP] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DESCRIPTION] nvarchar(250) COLLATE Chinese_PRC_CI_AS  NULL,
  [NEXT_FIRE_TIME] bigint  NULL,
  [PREV_FIRE_TIME] bigint  NULL,
  [PRIORITY] int  NULL,
  [TRIGGER_STATE] nvarchar(16) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TRIGGER_TYPE] nvarchar(8) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [START_TIME] bigint  NOT NULL,
  [END_TIME] bigint  NULL,
  [CALENDAR_NAME] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [MISFIRE_INSTR] int  NULL,
  [JOB_DATA] varbinary(max)  NULL
)
GO

ALTER TABLE [dbo].[QRTZ_TRIGGERS] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of QRTZ_TRIGGERS
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table QRTZ_BLOB_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_BLOB_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_BLOB_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_CALENDARS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_CALENDARS] ADD CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [CALENDAR_NAME])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_CRON_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table QRTZ_FIRED_TRIGGERS
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_QRTZ_FT_INST_JOB_REQ_RCVRY]
ON [dbo].[QRTZ_FIRED_TRIGGERS] (
  [SCHED_NAME] ASC,
  [INSTANCE_NAME] ASC,
  [REQUESTS_RECOVERY] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_FT_G_J]
ON [dbo].[QRTZ_FIRED_TRIGGERS] (
  [SCHED_NAME] ASC,
  [JOB_GROUP] ASC,
  [JOB_NAME] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_FT_G_T]
ON [dbo].[QRTZ_FIRED_TRIGGERS] (
  [SCHED_NAME] ASC,
  [TRIGGER_GROUP] ASC,
  [TRIGGER_NAME] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_FIRED_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [ENTRY_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_JOB_DETAILS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] ADD CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [JOB_NAME], [JOB_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_LOCKS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_LOCKS] ADD CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [LOCK_NAME])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_PAUSED_TRIGGER_GRPS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] ADD CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_SCHEDULER_STATE
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] ADD CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED ([SCHED_NAME], [INSTANCE_NAME])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_SIMPLE_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_SIMPROP_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table QRTZ_TRIGGERS
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_G_J]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [JOB_GROUP] ASC,
  [JOB_NAME] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_C]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [CALENDAR_NAME] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_N_G_STATE]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [TRIGGER_GROUP] ASC,
  [TRIGGER_STATE] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_STATE]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [TRIGGER_STATE] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_N_STATE]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [TRIGGER_NAME] ASC,
  [TRIGGER_GROUP] ASC,
  [TRIGGER_STATE] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_NEXT_FIRE_TIME]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [NEXT_FIRE_TIME] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_NFT_ST]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [TRIGGER_STATE] ASC,
  [NEXT_FIRE_TIME] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_NFT_ST_MISFIRE]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [MISFIRE_INSTR] ASC,
  [NEXT_FIRE_TIME] ASC,
  [TRIGGER_STATE] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_QRTZ_T_NFT_ST_MISFIRE_GRP]
ON [dbo].[QRTZ_TRIGGERS] (
  [SCHED_NAME] ASC,
  [MISFIRE_INSTR] ASC,
  [NEXT_FIRE_TIME] ASC,
  [TRIGGER_GROUP] ASC,
  [TRIGGER_STATE] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table QRTZ_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Foreign Keys structure for table QRTZ_CRON_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table QRTZ_SIMPLE_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table QRTZ_SIMPROP_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) REFERENCES [dbo].[QRTZ_TRIGGERS] ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table QRTZ_TRIGGERS
-- ----------------------------
ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY ([SCHED_NAME], [JOB_NAME], [JOB_GROUP]) REFERENCES [dbo].[QRTZ_JOB_DETAILS] ([SCHED_NAME], [JOB_NAME], [JOB_GROUP]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

